App.controller('myHadpayOrdersController', ['$rootScope', '$scope', '$state', '$window', 'Page',function($rootScope, $scope, $state, $window, Page) {
	$scope.orderList = [];
	
	$scope.searchOrder = function(){
		Page.ajaxPost('app/order/hadPaid.do',null, function(resp) {
			$scope.orderList = resp.data;
		});
	};
	
	$scope.viewOrder = function(order){
		$state.go("user.order",{orderId: order.orderId});
	};
	
	$scope.toRefund = function(order) {
		$state.go("user.orderRefund",{orderId: order.orderId});
	};
	
	$scope.searchOrder();
	
}]);